package edu.nctu.csie.jichang.dp.behavioral;


public class TemplateMethod {
	public static void main(String[] args) {
		TMethod tTMethod = new TMethod();
		tTMethod.doOperation();
	}

}
abstract class AbstractTMethod{
	public void doOperation(){
		init();
		execute();
		destory();
	}
	protected abstract void init();
	protected abstract void execute();
	protected abstract void destory();
}
class TMethod extends AbstractTMethod{
	protected void init() {System.out.println("init");}
	protected void execute() {System.out.println("execute");}
	protected void destory() {System.out.println("destory");}
}